import codecs
fp=codecs.open('Our_Fonts.txt','rb','utf16')
text=fp.read().replace('\r\n','')
fp.close()
chr_tbl=[]
for index,char in enumerate(text):
    if char not in chr_tbl:
        chr_tbl.append(char)
text=''.join(chr_tbl)

fp2=codecs.open('in.tbl','rb','utf16')
fp3=codecs.open('Font12.tbl','rb','utf16')
lines=fp2.readlines()
lines3=fp3.readlines()

intbl=[]
fonttbl=[]
for index,char in enumerate(text):
    for line in lines:
        if char in line:
            intbl.append(line)
            for line3 in lines3:
                if line[:4] in line3:
                    fonttbl.append(line3)
print ''.join(intbl)
print '-'*30
print ''.join(fonttbl)
fp2.close()
fp3.close()